<?php $this->load->view('_meta') ?>

<link REL="SHORTCUT ICON" HREF="<?php echo base_url() . APPPATH ?>themes/user/img/logo.png"/>
<title><?php echo empty($title_html) ? '' : $title_html ?></title>
<link href="<?php echo base_url() . APPPATH ?>themes/user/css/site.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url() . APPPATH ?>themes/admin/js/jquery/jquery.min.js"></script>	
<script type="text/javascript">
  var base_url='<?php echo site_url(); ?>';
  var country_id = 0, state_id = 0;
  jQuery(document).ready(function(){
    $('#country_id').bind({
      change: function (){detect_country_search($(this).val());},
      blur: function (){detect_country_search($(this).val());}
    });

    $('#state_id').bind({
      change: function (){detect_state_search($(this).val());},
      blur: function (){detect_state_search($(this).val());}
    }); 	
    detect_country_search($('#country_id').val());  
  });
  function detect_country_search(id){
    if(country_id != id){
      country_id = id;
      $('#state_id').html('<option value=""><?php echo $this->lang->line('label.state.select') ?></option>');
      if(id){
        $.post('<?php echo site_url('admin/ajax/list_json_state') ?>', {id : id}, function(data){		  
          if(data && data.length > 0){
            $.each(data, function(key, value){
              $('#state_id').append('<option '+
                (value['id'] == '<?php echo isset($obj['state_id']) ? $obj['state_id'] : 0 ?>' ? 'selected="selected"' :'' )
                +' value="'+value['id']+'">'+ value['name'] +'</option>');
            })
          }
        }, 'json');
      }
    }
  }
  
  function detect_state_search(id){
    if(state_id != id){
      state_id = id;
      $('#city_id').html('<option value=""><?php echo $this->lang->line('label.city.select') ?></option>');
      if(id){
        $.post('<?php echo site_url('admin/ajax/list_json_city') ?>', {id : id}, function(data){
          if(data && data.length > 0){
            $.each(data, function(key, value){
              $('#city_id').append('<option '+
                (value['id'] == '<?php echo isset($obj['city_id']) ? $obj['city_id'] : 0 ?>' ? 'selected="selected"' :'' )
                +' value="'+value['id']+'">'+ value['name'] +'</option>');
            })
          }
        }, 'json');
      }
    }
  }
  
  function setTimeAuction( objDayTime, diff ){
    if ( diff > 0 ) {
      var d = Math.floor(diff/ 86400);
      var h = Math.floor((diff - d * 86400)/ 3600);
      var m = Math.floor((diff - d * 86400 - h * 3600)/ 60);
      var s = diff - d * 86400 - h * 3600 - m * 60;
      $(objDayTime).find('#numdays').html(d);
      $(objDayTime).find('#numhours').html(h);
      $(objDayTime).find('#nummins').html(m);
      $(objDayTime).find('#numsecs').html(s);
      //      $( objDayTime ).html( d + ' <span style="color:#0D6998">days</span> ' + h + ":" + m + ":" + s );
    }
    else {
      window.location.reload( true );
    }
  }
  jQuery(function() {
    jQuery.support.placeholder = false;
    test = document.createElement('input');
    if('placeholder' in test) jQuery.support.placeholder = true;
  });
  // This adds placeholder support to browsers that wouldn't otherwise support it. 
  $(function() {
    if(!$.support.placeholder) { 
      var active = document.activeElement;
      $(':text').focus(function () {
        if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
          $(this).val('').removeClass('hasPlaceholder');
        }
      }).blur(function () {
        if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
          $(this).val($(this).attr('placeholder')).addClass('hasPlaceholder');
        }
      });
      $(':text').blur();
      $(active).focus();
      $('form:eq(0)').submit(function () {
        $(':text.hasPlaceholder').val('');
      });
    }
  });
</script>
<style type="text/css">
  form .require{
    color:red;
  }
</style>

<link rel="stylesheet" href="<?php echo base_url() . APPPATH ?>themes/admin/css/validationEngine.jquery.css" type="text/css"/>
<script src="<?php echo base_url() . APPPATH ?>themes/admin/js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo base_url() . APPPATH ?>themes/admin/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
  jQuery(document).ready(function(){
    jQuery("#form_subscribe").validationEngine();
  });
</script>
<script type="text/javascript" src="<?php echo base_url() . APPPATH ?>themes/welcome/js/jquery.complete-placeholder.min.js"></script> 
<script type="text/javascript" src="<?php echo base_url() . APPPATH ?>themes/welcome/js/jquery.pngFix.pack.js"></script> 

<script type="text/javascript" src="<?php echo base_url() . APPPATH ?>themes/welcome/js/jquery.lightbox_me.js"></script>	

<script type="text/javascript" src="<?php echo base_url() . APPPATH ?>themes/user/js/jquery.cycle.all.latest.js"></script>